#ifndef  __CTRANSROT_H__        // Begin 'include-guard' block.
#define  __CTRANSROT_H__        // (See #endif at the very end of this file).
// I use 'include guards' on every .h file, ahighly recommended practice for
// all C/C++ coding.  Include guards ensure that anything (var,struct,class)
// defined in your .h files will only get defined only once during compiling,
// even if that .h file gets '#include'-ed in many other files in your project.
// It makes your file 'idempotent'.  Otherwise, these multiple definitions will
// stop and/or generate errors in simpler, stricter, (usually older) and less
// forgiving compilers/linkers. See: http://en.wikipedia.org/wiki/Include_guard
//  **** DON'T FORGET THE #endif at this file's end!! ****

//==============================================================================
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_
//                               (why all the numbers? I prefer 80-column text)
//
// CTransRot.h        Our class for Mouse/Keyboard driven translation/rotation
//                    (Used only in _partMain.h and _partMain.cpp)
//==============================================================================


// multi-platform includes for the GLUT/OpenGL libraries:-----------------------
#if defined(_WIN32)
#include <GL\glew.h>        // OpenGL 'extensions wrangler' for easy access.
#include <GL\freeglut.h>// open-source GLUT functions for windows, keybd, mouse
/*---*OR*--- use:
// #include <GL/glut.h> // for 100% backwards-compatibility with Mark Kilgard's
                        // SGI-copyrighted GLUT library. Careful! this excludes
                        // freeglut's callbacks for mouse wheel, etc.
*/
/*
// freeglut.h already contains these other includes that were necessary for
// using Kilgard's original GLUT library:
#include <GL/GL.h>          // OpenGL 3D graphics rendering functions
#include <GL/Glu.h>         // OpenGL utilties functions
#include <GL/glext.h>       // #defines for all OpenGL features on your machine.
*/
#elif defined(__APPLE__)
#include <GLUT/glut.h>      // GLUT functions for windows, keybd, mouse
#include <OpenGL/GL.h>      // OpenGL 3D graphics rendering functions
#include <OpenGL/Glu.h>     // OpenGL utilties functions
#include <OpenGL/GLext.h>   // #defines for all OpenGL features on your machine.
// UNIX, Linux of all flavors;
#else
#include <unistd.h>         // defines symbolic constants, POSIX versions, etc.
#include <GL/glew.h>        // OpenGL 'extensions wrangler' for 'mesa' lib usage
#include <GL/freeglut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glext.h>
#endif
//-----------------------------end multi-platform includes for GLUT/OpenGL------

class CTransRot
//==============================================================================
// Declares a class to find mouse-driven rotation and translation we want for an
// OpenGL matrix (such as a GL_PROJECTION or GL_MODELVIEW matrix).  We'll make
// one instance of this class for each matrix we'll want to change by mouse.
// PURPOSE:
// Record/accumulate offset amounts and rotation amounts from mouse & keyboard
{
public:
double	x_pos, y_pos, z_pos;	// cumulative position offset
double	x_rot, y_rot, z_rot;	// cumulative rotation on x,y,z axes
int		isDragging;				// TRUE if user is holding down the mouse button
								// that affects our value(s); else FALSE.
int m_x,m_y;					// last mouse-dragging position.

~CTransRot(void);				// default destructor
 CTransRot(void);				// default constructor
void reset(void);				// reset everything to zero.
void applyMatrix(void);			// apply translations, rotations to openGL.
};

#endif //end of #ifndef  __CTRANSROT_H__ include guard
